asm: deny OpTypeVector, always infer type from asm params#392
Merged
Firestar99 merged 6 commits intomainfrom Sep 17, 2025
Merged
asm: deny OpTypeVector, always infer type from asm params#392Firestar99 merged 6 commits intomainfrom
OpTypeVector, always infer type from asm params#392Firestar99 merged 6 commits intomainfrom
Conversation
cc0bfa6 to
48eb5ac
Compare
48eb5ac to
538314e
Compare
eddyb
requested changes
Sep 17, 2025
Comment on lines
720
to
726
| | ( | ||
| TyPat::Vector4(pat), | ||
| SpirvType::Vector { | ||
| element: ty, | ||
| count: 4, | ||
| }, | ||
| ) |
Member
There was a problem hiding this comment.
This one might be fine to keep? Since it expects the vector to already exist, it's not synthesizing a new one.
Member
Author
There was a problem hiding this comment.
In theory yes, we could. But without the change below constructing a SpirvType::Vector, automatic type resolution doesn't work anyway. Just tried it by undoing the OpSample* explicit typing I added.
Will readd it anyway, can't hurt :D
| create different vector types due to varying size and alignment", | ||
| ) | ||
| .with_note( | ||
| "pass `glam::VecN` as parameters and use `typeof{foo}` or `typeof*{foo}` (pointer to type) to resolve vector type", |
Member
There was a problem hiding this comment.
In theory we could extract the operands and suggest the exact correct type, but that feels overkill.
…e non-sense ConstOffset
538314e to
6aa48ff
Compare
eddyb
approved these changes
Sep 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requires #391
Upcoming PR #380 allows
OpTypeVectorto have a "dynamic" size and alignment, to properly differentiate betweenVec3andVec3A. But that implies that we can't trivially construct anOpTypeVector, since we don't know the sizes or alignments it should have. In preparation, this PR denies all usages ofOpTypeVectorinasm!blocks and changes existing ones to infer the type withtypeof{param}ortypeof*{param}, the latter being a pointer to the type that can beOpStore'ed.